package com.carmeth.geo;

import com.carmeth.geo.bean.Casa;

import android.content.Context;
import android.text.Html;
import android.widget.LinearLayout;
import android.widget.TextView;

public class CasaView extends LinearLayout{

	private Casa casa;
	private TextView _lblTitle;
	private TextView _lblSubject;
	
	public CasaView(Context context) {
		super(context);
	}
	
	public CasaView(Context ctx, Casa casa){
		super(ctx);
		this.casa = casa;
		this.setOrientation(VERTICAL);
		init();
	}
	
	public void init(){
		_lblTitle = new TextView(getContext());
		_lblTitle.setText(Html.fromHtml("<b>" + casa.getTitulo() + "</b>"));
		this.addView(_lblTitle);
		_lblSubject = new TextView(getContext());
		_lblSubject.setText(casa.getDescripcion());
		this.addView(_lblSubject);
	}

	public void update(Casa casa){
		_lblTitle.setText(Html.fromHtml("<b>" + casa.getTitulo() + "</b>"));
		_lblSubject.setText(casa.getDescripcion());
	}
}
